<?php

/**
 * 用于输出webview的类
 */
class WebView {

    /**
     * WebView工作函数
     *
     * @param string $title 页面的title
     * @param string $body 页面的内容body
     * @param string $css 页面的css样式字符串
     * @return void
     */
    public static function action(string $title, string $body, string $css) {
        echo "
        <!DOCTYPE html>
        <html lang='zh-CN'>
            <head>
                <meta charset='utf-8'>
                <meta http-equiv='X-UA-Compatible' content='IE=edge'>
                <meta name='viewport' content='width=device-width, initial-scale=1'>
                <title>${title}</title>
                <style>
                ${css}
                </style>
            </head>
            <body>
                ${body}
            </body>
        </html>
        ";
    }
}

